.class public Lcom/adview/adapters/UmengAdapter;
.super Lcom/adview/adapters/AdViewAdapter;
.source "UmengAdapter.java"

# interfaces
.implements Lcom/umengAd/controller/UmengAdListener;


# direct methods
.method public constructor <init>(Lcom/adview/AdViewLayout;Lcom/adview/obj/Ration;)V
    .locals 0
    .parameter "adViewLayout"
    .parameter "ration"

    .prologue
    .line 22
    invoke-direct {p0, p1, p2}, Lcom/adview/adapters/AdViewAdapter;-><init>(Lcom/adview/AdViewLayout;Lcom/adview/obj/Ration;)V

    .line 24
    return-void
.end method


# virtual methods
.method public handle()V
    .locals 6

    .prologue
    .line 30
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v3

    sget-object v4, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v3, v4, :cond_0

    .line 31
    const-string v3, "AdView SDK v1.7.0"

    const-string v4, "Into Umeng"

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 32
    :cond_0
    iget-object v3, p0, Lcom/adview/adapters/UmengAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v3}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/adview/AdViewLayout;

    .line 33
    .local v2, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v2, :cond_2

    .line 62
    :cond_1
    :goto_0
    return-void

    .line 39
    :cond_2
    iget-object v3, v2, Lcom/adview/AdViewLayout;->activityReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v3}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/Activity;

    .line 40
    .local v0, activity:Landroid/app/Activity;
    if-eqz v0, :cond_1

    .line 45
    iget-object v3, v2, Lcom/adview/AdViewLayout;->umengView:Landroid/widget/RelativeLayout;

    if-nez v3, :cond_3

    .line 47
    new-instance v1, Lcom/umengAd/android/AdView;

    invoke-direct {v1, v0}, Lcom/umengAd/android/AdView;-><init>(Landroid/content/Context;)V

    .line 50
    .local v1, adView:Lcom/umengAd/android/AdView;
    iget-object v3, p0, Lcom/adview/adapters/UmengAdapter;->ration:Lcom/adview/obj/Ration;

    iget-object v3, v3, Lcom/adview/obj/Ration;->key:Ljava/lang/String;

    iget-object v4, p0, Lcom/adview/adapters/UmengAdapter;->ration:Lcom/adview/obj/Ration;

    iget-object v4, v4, Lcom/adview/obj/Ration;->key2:Ljava/lang/String;

    invoke-virtual {v1, v3, v4}, Lcom/umengAd/android/AdView;->adInit(Ljava/lang/String;Ljava/lang/String;)V

    .line 54
    iput-object v1, v2, Lcom/adview/AdViewLayout;->umengView:Landroid/widget/RelativeLayout;

    .line 58
    .end local v1           #adView:Lcom/umengAd/android/AdView;
    :cond_3
    iget-object v3, v2, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v3}, Lcom/adview/AdViewManager;->resetRollover()V

    .line 59
    iget-object v3, v2, Lcom/adview/AdViewLayout;->handler:Landroid/os/Handler;

    new-instance v4, Lcom/adview/AdViewLayout$ViewAdRunnable;

    iget-object v5, v2, Lcom/adview/AdViewLayout;->umengView:Landroid/widget/RelativeLayout;

    invoke-direct {v4, v2, v5}, Lcom/adview/AdViewLayout$ViewAdRunnable;-><init>(Lcom/adview/AdViewLayout;Landroid/view/ViewGroup;)V

    invoke-virtual {v3, v4}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 60
    invoke-virtual {v2}, Lcom/adview/AdViewLayout;->rotateThreadedDelayed()V

    goto :goto_0
.end method

.method public onRequestFail(Lcom/umengAd/android/AdView;)V
    .locals 3
    .parameter "paramAdView"

    .prologue
    .line 66
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 67
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, "Umeng failure"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 69
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcom/umengAd/android/AdView;->setUmengAdListener(Lcom/umengAd/controller/UmengAdListener;)V

    .line 71
    iget-object v1, p0, Lcom/adview/adapters/UmengAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adview/AdViewLayout;

    .line 72
    .local v0, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v0, :cond_1

    .line 77
    :goto_0
    return-void

    .line 75
    :cond_1
    iget-object v1, v0, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v1}, Lcom/adview/AdViewManager;->resetRollover_pri()V

    .line 76
    invoke-virtual {v0}, Lcom/adview/AdViewLayout;->rotateThreadedPri()V

    goto :goto_0
.end method

.method public onRequestSuccess(Lcom/umengAd/android/AdView;)V
    .locals 3
    .parameter "paramAdView"

    .prologue
    .line 81
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 82
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, "Umeng success"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 84
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcom/umengAd/android/AdView;->setUmengAdListener(Lcom/umengAd/controller/UmengAdListener;)V

    .line 86
    iget-object v1, p0, Lcom/adview/adapters/UmengAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adview/AdViewLayout;

    .line 87
    .local v0, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v0, :cond_1

    .line 94
    :goto_0
    return-void

    .line 91
    :cond_1
    iget-object v1, v0, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v1}, Lcom/adview/AdViewManager;->resetRollover()V

    .line 92
    iget-object v1, v0, Lcom/adview/AdViewLayout;->handler:Landroid/os/Handler;

    new-instance v2, Lcom/adview/AdViewLayout$ViewAdRunnable;

    invoke-direct {v2, v0, p1}, Lcom/adview/AdViewLayout$ViewAdRunnable;-><init>(Lcom/adview/AdViewLayout;Landroid/view/ViewGroup;)V

    invoke-virtual {v1, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 93
    invoke-virtual {v0}, Lcom/adview/AdViewLayout;->rotateThreadedDelayed()V

    goto :goto_0
.end method
